<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li class="active" ng-bind="title"></li>
        <a style="float: right;margin-right: 12%;margin-top: -10px;"
           has-permission permission='hui.frequency.add'	ui-sref="main.hui.frequency.create" class="btn btn-sm btn-info">
            <i class="icon-tag m-r-sm text-md"></i>添加广告频率</a>
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <!-- 头部 -->
            <div class="panel-body">
                <form ng-submit="searchRe()" class="form-horizontal">
                    <div class="form-group">
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="param.adType" style="color: black"
                                    id="adType" name="adType"  ng-change="search()">
                                <option value="1"  ng-selected="1">--驿站精选--</option>
                                <option value="2">--资讯列表--</option>
                                <option value="3">--社区帖子列表--</option>
                                <option value="4">--粉丝列表--</option>
                                <option value="5">--关注列表--</option>
                            </select>
                        </div>


                    </div>

                </form>
            </div>
            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center sort" >
                    <thead>
                    <tr>
                        <!--<th><input type="checkbox" ng-click="selectAll($event)"/>全选</th>-->
                        <th>序号</th>
                        <th>最小值</th>
                        <th>最大值</th>
                        <th>状态</th>
                        <th>广告类型</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="bannerList">
                    <tr ng-repeat="item in pageInfo.records">
                        <!--<td class="v-middle">-->
                            <!--<input type="checkbox" name="selected" ng-checked="isSelected(item.id)" ng-click="updateSelection($event,item)"/>-->
                        <!--</td>-->
                        <td class="v-middle">{{$index + 1}}</td>
                        <td class="v-middle" style="display: none">{{item.id}}</td>
                        <td class="v-middle"><span id="clickPrice{{item.id}}">{{item.minNum}}</span>
                            <div id="btn{{item.id}}" style="display: none"><input type="text" id="minNum{{item.id}}" style="width: 50px"  value="{{item.minNum}}"></div>
                            <div id="btnss{{item.id}}" style="display: none"><input type="text" id="minNums{{item.id-1}}" style="width: 50px"  value="{{item.minNum}}"></div>
                        </td>

                        <td class="v-middle"><span id="clickPrices{{item.id}}">{{item.maxNum}}</span>
                            <div id="btns{{item.id}}" style="display: none"><input type="text" id="maxNum{{item.id}}" style="width: 50px"  value="{{item.maxNum}}"></div>
                            <div id="btnsss{{item.id}}" style="display: none"><input type="text" id="maxNums{{item.id+1}}" style="width: 50px"  value="{{item.maxNum}}"></div>
                        </td>
                        <td class="v-middle">
                            <span ng-if="item.isEnable=='Y'">启用</span>
                            <span ng-if="item.isEnable=='N'">禁用</span>
                        </td>
                        <td class="v-middle">
                            <span ng-if="item.adType=='1'">驿站精选</span>
                            <span ng-if="item.adType=='2'">资讯列表</span>
                            <span ng-if="item.adType=='3'">社区帖子列表</span>
                            <span ng-if="item.adType=='4'">粉丝列表</span>
                            <span ng-if="item.adType=='5'">关注列表</span>

                        </td>

                        <td class="v-middle">
                            <div class="row">
                                <div class="col-md-4">
                                </div>
                                <div class="col-md-4">
                                   <div class="col-md-6" >
                                       <div style=" width:50px;  margin: 0 auto;padding-top: 12%">
                                           <input ng-if="item.isEnable=='Y'" ng-click="oper(item.id,$event)" id="checked_{{item.id}}"  checked type="checkbox" class="switch" />
                                           <input ng-if="item.isEnable=='N'" ng-click="oper(item.id,$event)" id="checked_{{item.id}}"  type="checkbox" class="switch" />
                                           <label style="margin-bottom: 0px;" class="switchlabel" for="checked_{{item.id}}"></label>
                                       </div>
                                   </div>
                                    <div class="col-md-4" >
                                    <!--<span>-->
                                        <!--<a   ui-sref="main.hui.frequency.update({id: item.id})" class="btn btn-sm btn-default">-->
                                        <!--<i class="fa fa-edit m-r-xs text-sm"></i>编辑-->
                                       <!--</a>-->
                                    <!--</span>-->
                                        <span id="editStart{{item.id}}">
                                        <a   ng-click="editSort(item.id)" class="btn btn-sm btn-default">
                                        <i class="fa fa-edit m-r-xs text-sm"></i>编辑
                                       </a>
                                    </span>
                                        <span style="display: none" id="editEnd{{item.id}}">
                                        <a   ng-click="edit(item.id,item.minNum,item.maxNum,item.adType)" class="btn btn-sm btn-default">
                                        <i class="fa fa-edit m-r-xs text-sm"></i>保存
                                       </a>
                                    </span>
                                    </div>

                                </div>
                                <div class="col-md-4">
                                </div>

                                <!--&lt;!&ndash;2 要使用删除的话将1 注释将2放开即可使用，目前还用不上删除，但是删除功能已经完善&ndash;&gt;-->
                              <!--<div >-->
                                    <!--<span>-->
                                        <!--<a   ui-sref="main.hui.frequency.update({id: item.id})" class="btn btn-sm btn-default">-->
                                        <!--<i class="fa fa-edit m-r-xs text-sm"></i>编辑-->
                                       <!--</a>-->
                                    <!--</span>-->
                                  <!--&lt;!&ndash;该功能已经完成，暂时不用删除，如果需要代码放开即可&ndash;&gt;-->
                                    <!--<span>-->
                                        <!--<a ng-click="deleteById(item.id)" class="btn btn-sm btn-default">-->
                                        <!--<i class="fa fa-ban m-r-xs text-sm"></i>删除-->
                                       <!--</a>-->
                                    <!--</span>-->
                              <!--</div>-->

                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->
            <div class="cover" ng-show="firstApply">
                <div class="firstApplyWrap noselect">
                    <div class="clear"><i class="iconfont closeBtn noselect" ng-click="firstApply=false">&#xe608;</i></div>
                    <div class="title">
	           			<span ng-repeat="item in businessLicenses track by $index">
	           				<a target='_blank' href='{{item}}'><img alt='' height='100' width='300' src='{{item}}'></a>
                            <!-- <img alt="" height="100" width="100" ng-repeat="item in businessLicenses track by $index" src="{{item}}"> -->
	           			</span>
                    </div>
                </div>
            </div>
            <!-- 底部分页 -->
            <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div><!-- /.panel -->
    </div><!-- /.wrapper-data -->

</div><!-- /.wrapper-md -->

<style>
    .cover {
        position: fixed;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 2000;
        top: 0;
        left: 0;
        /* display: none; */
    }

    .firstApplyWrap{
        width: 550px;
        height:280px;
        background: #fff;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
        -webkit-transform: translate(-50%,-50%);
        -ms-transform: translate(-50%,-50%);
        -o-transform: translate(-50%,-50%);
        -moz-transform: translate(-50%,-50%);
        border-radius: 5px;
        overflow: hidden;
    }
    .firstApplyWrap .title{
        font-size: 18px;
        color:#333;
        padding:18px 86px 0 130px;
        text-align: center;
        line-height: 2em;
    }
    .firstApplyWrap .closeBtn,.finishData .closeBtn{
        font-size: 30px;
        padding:5px 20px 0 0;
        border-radius: 50%;
        color: #ccc;
        float: right;
        cursor: pointer;
    }
    .finishData .closeBtn{
        position: absolute;
        top:10px;
        right:10px;
    }
    .firstApplyWrap .bkgIcon{
        position: absolute;
        left: 54px;
        top:87px;
        font-size: 50px;
        color:#FFB136;
    }
    .firstApplyWrap .applyBtnWrap{
        position: absolute;
        bottom: -2px;
        width: 100%;
    }
    .firstApplyWrap .applyBtn{
        width: 50%;
        height:70px;
        line-height: 70px;
        background: #FFB135;
        font-size: 20px;
        text-align: center;
        color:#fff;
        cursor: pointer;
        float:left;
    }
    .firstApplyWrap .applyBtn:last-child{
        background: #5796FC;
    }


    .switch{
        display:none;
    }
    .switchlabel{
        position:relative;
        display: block;
        padding: 1px;
        border-radius: 24px;
        height: 22px;
        margin-bottom: 15px;
        background-color: #eee;
        cursor: pointer;
        vertical-align: top;
        -webkit-user-select: none;
    }
    .switchlabel:before{
        content: '';
        display: block;
        border-radius: 24px;
        height: 22px;
        background-color: #BFBFBF;
        -webkit-transform: scale(1, 1);
        -webkit-transition: all 0.3s ease;
    }
    .switchlabel:after{
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        margin-top: -11px;
        margin-left: -11px;
        width: 22px;
        height: 22px;
        border-radius: 22px;
        background-color: white;
        box-shadow: 1px 1px 1px 1px rgba(0,0,0,0.08);
        -webkit-transform: translateX(-9px);
        -webkit-transition: all 0.3s ease;
    }
    .switch:checked~label:after{
        -webkit-transform: translateX(9px);
    }
    .switch:checked~label:before{
        background-color:green;
    }
</style>